package com.atguigu.srb.core.controller.api;


import com.atguigu.srb.base.response.R;
import com.atguigu.srb.core.pojo.entity.TransFlow;
import com.atguigu.srb.core.service.TransFlowService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 交易流水表 前端控制器
 * </p>
 *
 * @author Atguigu
 * @since 2023-05-26
 */
@RestController
@RequestMapping("/api/core/transFlow")
public class ApiTransFlowController {
    @Resource
    TransFlowService transFlowService;
    @ApiOperation("会员查询自己的资金记录")
    @GetMapping("auth/list")
    public R list(@RequestHeader("token")String token){
        List<TransFlow> transFlowList = transFlowService.listByUserId(token);
        return R.ok().data("items",transFlowList);
    }
}

